{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Ch `10`: Concept `01`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "## Processing timeseries data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Load a CSV file, where each row is a feature vector:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import csv\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "def load_series(filename, series_idx=1):\n",
    "    try:\n",
    "        with open(filename) as csvfile:\n",
    "            csvreader = csv.reader(csvfile)\n",
    "            \n",
    "            data = [float(row[series_idx]) for row in csvreader if len(row) > 0]\n",
    "            normalized_data = (data - np.mean(data)) / np.std(data)\n",
    "        return normalized_data\n",
    "    except IOError:\n",
    "        return None"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Split the timeseries dataset into two components. The first section will be for training, and the next section will be for testing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "def split_data(data, percent_train=0.80):\n",
    "    num_rows = len(data)\n",
    "    train_data, test_data = [], []\n",
    "    for idx, row in enumerate(data):\n",
    "        if idx < num_rows * percent_train:\n",
    "            train_data.append(row)\n",
    "        else:\n",
    "            test_data.append(row)\n",
    "    return train_data, test_data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Download some CSV timeseries data. Like the one here https://datamarket.com/data/set/22u3/international-airline-passengers-monthly-totals-in-thousands-jan-49-dec-60#!ds=22u3&display=line."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(144,)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEACAYAAABRQBpkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXmYVNW1t9/FPMkoQ6ARFRAFFXBArphrq6gQjWjimESN\nMdHP6E2umTRqAiQ3cUhMzL2aqAlGo0acFSeiXu2LogwKCDKrDN0IzSwy0/T+/lh17OrqGk7V2dVV\n3b3e5+mHU+ec2nv3AfbvrLX2XkuccxiGYRhNm2aFHoBhGIZReEwMDMMwDBMDwzAMw8TAMAzDwMTA\nMAzDwMTAMAzDwJMYiEhrEZkpInNFZIGIjE9yTysRmSwiy0XkXRE5yEffhmEYRnS8iIFzbg9winNu\nODAMGCsiIxJuuxLY7JwbCNwF3OGjb8MwDCM63txEzrmdscPWQAsgcTfbOOCh2PFTwGm++jYMwzCi\n4U0MRKSZiMwF1gGvOedmJ9zSBygHcM7tB7aKSFdf/RuGYRi549MyqI65iUqAE0RkcIaviK++DcMw\njGi08N2gc26biLwJjAEWxV2qAPoCn4pIc6Cjc25z4vdFxJIlGYZhZIlzLtILtq/VRAeKSKfYcVvg\ndGBJwm0vAJfHji8A3kjVnnOuqH/Gjx9f8DHYOG2cNk4bZ/DjA1+WwZeAh0SkGSowjzvnXhaRicBs\n59yLwCTgYRFZDmwCLvbUt2EYhhERL2LgnFsAHJPk/Pi44z3AhT76MwzDMPxiO5BzoLS0tNBDCIWN\n0y82Tr/YOIsL8eVv8oWIuGIbk2EYRjEjIrhiCCAbhmE0dNatg4suKvQoCoeJgWEYBrBqFTzxBHz8\ncaFHUhhMDAzDMIDPPtM/n322sOMoFCYGhmEYqBh06WJiYBiG0aT57DM46yxYtEjjB00NEwPDMAxU\nDLp3hzFjYMq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O8KOvnWV/B\njxDBkTHoSp3lwI2FHk/cuEYB+9EVTnNR3/EYoCvwemzMrwKdCz3W2HhPpiaAfAgwE1iGBptaFnp8\nsXENRV8A5qFvNp2K7XmiboLFwHzgIXSVW1E8T+CfwKfAHlS4rkCD3UmfH3A3uqLkA+CYAo5xORqY\nnxP7+XPc/T+PjXExcEYhn2XC9U+IBZAL9SzTPM8WwMNoKYH3gJOjPE/bdGYYhmEUjZvIMAzDKCAm\nBoZhGIaJgWEYhmFiYBiGYWBiYBiGYWBiYBiGYWBiYBiGYWBiYBiGYQD/H8Gwl2Y0hMNiAAAAAElF\nTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f7f6fc90080>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "if __name__=='__main__':\n",
    "    # https://datamarket.com/data/set/22u3/international-airline-passengers-monthly-totals-in-thousands-jan-49-dec-60#!ds=22u3&display=line\n",
    "    timeseries = load_series('international-airline-passengers.csv')\n",
    "    print(np.shape(timeseries))\n",
    "\n",
    "    plt.figure()\n",
    "    plt.plot(timeseries)\n",
    "    plt.show()\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
